﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using App.Interface;
using App.Model;
using Newtonsoft.Json;

namespace App.MVC.Controllers
{
    public class AdminController : BaseController
    {
        public IMyCaoZuo _iMyCaoZuo { set; get; }
        public IAdmin _IAdmin { set; get; }
        // GET: Admin
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult CheckFenZhi()
        {
            return View();
        }
        public JsonResult Gets()
        {
            string str = _IAdmin.CheckJiaoShis();
            JiaoZhiGongList tt = new JiaoZhiGongList();

            if (!string.IsNullOrWhiteSpace(str))
            {
                tt = JsonConvert.DeserializeObject<JiaoZhiGongList>(str);
            }
            return Json(tt, JsonRequestBehavior.AllowGet);
        }
        public void GongZuoJiHuaReject(string username)
        {
            _iMyCaoZuo.UpdateGongZuoJiHuaRejectByusername(username);
        }
    }
}